home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / docs / lwml9504.lha / LIGHTWAVE-APR95 / 000264_owner-lightwave-l _Tue Apr 11 23:59:49 1995.msg < prev    next >
Internet Message Format  |  1995-05-06  |  7KB

  1. Return-Path: <owner-lightwave-l>
  2. Received: by netcom11.netcom.com (8.6.12/Netcom)
  3.     id VAA19446; Tue, 11 Apr 1995 21:27:35 -0700
  4. Received: by netcom13.netcom.com (8.6.12/Netcom)
  5.     id NAA16334; Tue, 11 Apr 1995 13:31:01 -0700
  6. Date: Tue, 11 Apr 1995 13:31:01 -0700
  7. From: shf (Stuart Ferguson)
  8. Message-Id: <199504112031.NAA16334@netcom13.netcom.com>
  9. To: cjohnson@crl.com, downinit@teleport.com
  10. Subject: Re: Revenge of the NURBS
  11. Cc: lightwave-l@netcom.com
  12. Sender: owner-lightwave-l@netcom.com
  13. Precedence: bulk
  14.  
  15. re: What are NURBs?
  16.  
  17. NURBs is a cool acronym that everyone knows is a good thing but almost
  18. no one can tell you why.  NURBs are a "check-list" item that every 3D
  19. graphics program has to have for marketing reasons.  NURBs is something
  20. that I'm asked for constantly by users and NewTek marketing alike, but
  21. no one can tell my what they would do if they had them.
  22.  
  23. But seriously, NURBs are a special type of B-spline developed for use
  24. in 3D graphics.  A cubic spline is a piecewise-cubic parametric curve
  25. used to approximate a shape which may have an otherwise more complex
  26. parameteric form.  There are a wide variety of different cubic splines
  27. used in graphics applications, each with different properties and 
  28. usages.  The most common by far is the Bezier spline.  These are used in
  29. 2D drawing applications and are usually controled by a set of points
  30. along the curve with "handles" at each point which control the shape
  31. of the curve at that point.  The handles control the slope of the 
  32. curve through the point and how flat or round the curve is there.  In
  33. normal cases the interface will constrain the slope and roundness to
  34. be the same on both sides of the control point (C1 continuity), but in
  35. some cases the symmetry can be broken so the slope is the same but the
  36. roundness is different (G1 continuity), or both the slope and roundness
  37. are different (C0 continuity).
  38.  
  39. LightWave uses a special form of cubic spline to interpolate keyframes
  40. while animating.  The positions to interpolate are the keyframe locations,
  41. and the curvature information is computed using the tension, continuity
  42. and bias values at each key.  These are eqivalent to the handles on a
  43. Bezier spline.  If continuity is zero, the curve is C1; if continuity
  44. is non-zero, the curve is C0.  Note that G1, so-called geometric
  45. comtinuity, is only useful for making curves to fit shapes, not for 
  46. animation.  LightWave's splines are non-uniform, which is to say that
  47. the number of frames between each key can vary.
  48.  
  49. Modeler's splines use a formula for the curvature at each knot which
  50. makes them smoothly interpolate all their points.  The reason for this
  51. is interface simplicity, so that moving points exactly controls the shape
  52. of the curve.  They are always C1.
  53.  
  54. The nice thing about all these types of splines is that they interpolate
  55. their control points.  That is, the curve actually touches each knot or
  56. key that the user sets down.  The bad thing about these curves is that 
  57. they are only C1.  This means that while the tangent to the curve is
  58. continuous across the knot, the rate-of-change of the tangent is not.
  59. You can sometimes see this when animating as a sudden change in
  60. acceleration as an object passes a keyframe.
  61.  
  62. B-splines are the next class of cubic spline which address this issue.
  63. B-splines are C2, which means that the tangent and the rate-of-change
  64. of the tangent are continuous across control points which makes this
  65. type of curve very smooth both when animating and when creating 2D
  66. shapes.  The cost is that B-splines do NOT interpolate their control
  67. points.  The points laid down by the user become more of a rough
  68. guide for the shape of the curve which wends it way smoothly between
  69. but rarely touching any of the points.  There are no handles -- the
  70. shape of the spline is given entirely by the control points.
  71.  
  72. There is one more step to go to get to NURBs.  NURBs are a type of
  73. B-spline and have all the properties that generic B-splines have: C2,
  74. no handles, no passing through control points.  They are also non-
  75. uniform, which is useful for setting keyframes at arbitrary points
  76. in time, but is not a really useful property when modeling.  They
  77. have two additional properties which distinguish them from generic
  78. B-splines and to get to those we have to talk for a second about
  79. homogeneous coordinates.
  80.  
  81. People who work in 3D graphics really like matrices.  They like the
  82. fact that any move in 3D space can be defined by a matrix which can
  83. be multiplied by a vector to get the vector after the move.  To add
  84. a new move you just compose the matrices and the composite move can
  85. then be applied en-masse to a set of points.  Things are also easy
  86. to solve using matrices since it is all linear algebra.  The thing
  87. they don't like is the perspective transfrom which actually uses a
  88. division (gasp!) which takes it out of the realm of things which can
  89. be done with matrices and linear equations (egad!).  So the academics
  90. in the field invented homogeneous coordinates.
  91.  
  92. Normally a position in 3D space can be given by a vector of three
  93. values (X Y Z).  In homogeneous coordinates a position is given by
  94. a vector of four values (X Y Z W), whose three-space position is
  95. given by (X/W Y/W Z/W).  Note that this contains a division, so the
  96. homogeneous coordinate transform (a 4x4 matrix) can encode the 
  97. perspective transformation in three-space.  Oh happy day, we're
  98. back to linear algebra to do the whole 3D to 2D transformation,
  99. including, rotation, scaling, translation and perspective transform.
  100.  
  101. So NURBs, Non-Uniform Rational B-splines, are non-uniform B-splines
  102. in homogeneous coordinates.  The "Rational" part refers to the
  103. division you do to get from homogeneous coordinates to ordinary
  104. three-space coordinates.  The first result of this is that you can
  105. put the control points of a NURB through a perspective transform
  106. and get a new NURB which is just what the orignal curve would look
  107. like from that same perspective.  This is no surprise, however, 
  108. since to compute each point along the NURB you have to perform
  109. two divisions, which is just what you would have to do if you
  110. computed the curve in three-space and applied the perspective
  111. transform yourself.  This property is therefore of NO VALUE to
  112. the end user and is of only theoretic interest.
  113.  
  114. The other property is more interesting to end users.  Because of
  115. this additional division used to compute each point along the
  116. curve, it is possible to make NURBs which exactly fit circles and
  117. ellipses.  This makes NURBs of great interest for CAD/CAM and
  118. mechanical simulation applications.  For animators, however, the
  119. circles that can be made with generic B-splines, or even ordinary
  120. C1 splines, can be made so close to actual circles that no one
  121. could ever tell the difference.
  122.  
  123. In my opinion, NURBs are only interesting to the typical animator as
  124. a buzzword.  If you are truely more interested in the art than the
  125. technology, forget NURBs, they solve nothing for you.  B-splines, on
  126. the other hand are extremely interesting because of their very nice
  127. smoothness that results from being C2 continuous.  It's very probable
  128. you'll see B-splines in Modeler soon.  NURBs, probably never.
  129.  
  130.     - Stuart Ferguson